package com.ruoyi.ob.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/ob/report")
public class PurchaseReportController {

    /**
     * 直接返回采购数据汇总仪表盘页面（含假数据）
     */
    @GetMapping("/dashboard")
    public String purchaseDashboard() {
        // 对应模板路径：src/main/resources/templates/ob/purchaseDashboard.html
        return "ob/purchaseDashboard";
    }

    /**
     * 兼容旧接口的重定向（可选）
     * 若前端仍有接口请求，可返回空数据或重定向到页面
     */
    @GetMapping("/quantitySummaryByGoods")
    public String redirectToDashboard() {
        return "redirect:/ob/report/dashboard";
    }

    // 其他数据接口可类似处理，统一重定向到仪表盘页面
    @GetMapping("/amountSummaryBySupplier")
    public String redirectToDashboard1() {
        return "redirect:/ob/report/dashboard";
    }

    @GetMapping("/purchaseTrend")
    public String redirectToDashboard2() {
        return "redirect:/ob/report/dashboard";
    }

    @GetMapping("/statistics")
    public String redirectToDashboard3() {
        return "redirect:/ob/report/dashboard";
    }

    @GetMapping("/recentOrders")
    public String redirectToDashboard4() {
        return "redirect:/ob/report/dashboard";
    }
}